package com.sfexpress.mycatweb.controller.topo;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.sfexpress.mycatweb.controller.AppResult;
import com.sfexpress.mycatweb.entity.topo.TopoNode;
import com.sfexpress.mycatweb.service.topo.TopoService;

@Controller
public class TopoController {
	
	@Autowired
	private TopoService topoService;
	
	@RequestMapping("/gettopo")
	@ResponseBody
	public AppResult getClusterTopo() throws Exception {
		TopoNode topoRootData = topoService.getClusterTopo();
		AppResult result = new AppResult();
		result.setSuccess(true);
		result.setRow(topoRootData);
		return result;
	}

}
